<?php

/**
 *symbol search form class
 **/

include_once('Zend/Form.php');
require_once('Zend/Validate.php');
require_once('Zend/Validate/Alnum.php');
class Form_Findsymbol extends Zend_Form
{
/*
	public function init() {
		$this->_form = new Zend_Form();
		$this->_form->setMethod('post')
			->setAttrib('NAME', 'findsymbolform')
      		->setAttrib('id', 'findsymbolform')
            ->setAction('')
            ->addElements(array(
                'symbol' => array(
                    'type' => 'text', 
                    'options' => array(
                            'filters'        => array('StringTrim'),
                            'dojoType'       => array('dijit.form.ComboBox'),
                            'store'          => 'symbolStore',
                            'autoComplete'   => 'false',
                            'hasDownArrow'   => 'false',
                            'label' => 'Find Symbol:',
                    )),
                'submit' => array('type' => 'submit',
                'options' => array('label' => 'Find!'))
                ));
		
	}
*/

public function init()
  {
    
	$symbol = new Zend_Form_Element_Text('symbol');
	$symbol->setLabel('Find Symbol:')
				->addValidator('alnum')
				->addFilter('StringTrim')
                ->setRequired(true);
      
	$submit = new Zend_Form_Element_Submit('submit');
	
	
	//Prepend an opening div tag before "one" element:
$symbol->addDecorator('HtmlTag', array(
    'tag' => 'div',
    'openOnly' => true,
	'class' => 'symbolform',
    'placement' => Zend_Form_Decorator_Abstract::PREPEND
));
 
//Append a closing div tag after "two" element:
$submit->addDecorator('HtmlTag', array(
    'tag' => 'div',
    'closeOnly' => true,
    'placement' => Zend_Form_Decorator_Abstract::APPEND
));

	
    
	$this->addElements(array($symbol, $submit));
    $this->setMethod('post');
    $this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl().'/quote/findsymbol');
	$this->setAttrib('id', 'findsymbolform');
	$this->setAttrib('NAME', 'findsymbolform');
  }



  //close class
}